Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 2 fuera de 6 páginas
Examen

DAD 220 4-2 Lab - Cardinality and Targeted Data.

Document preview thumbnail
Vista previa 2 fuera de 6 páginas

1. Retrieve employee tuples and identify the number of employees in San Francisco and New York. SELECT firstName, lastName, jobTitle, FROM employees INNER JOIN offices ON eCode = eCode WHERE state = 'CA'; SELECT firstName, lastName, jobTitle, FROM employees INNER JOIN offices ON eCode = eCode WHERE state = 'NY';

Vista previa del contenido

Module Four Lab: Cardinality and Targeted Data
i i i i i i




Before we can even attempt the assignment, we must load the sample database to work with the cla
i i i i i i i i i i i i i i i i i


ssicmodels database. The code to launch the sample database is provided to us. We establish a MySQ
i i i i i i i i i i i i i i i i


L session as usual and enable the database with a USE statement.
i i i i i i i i i i i




1. Retrieve employee tuples and identify the number ofiemployees in San Francisco and N
i i i i i i i i i i i i


ew York.
i




SELECT firstName, lastName, jobTitle, offices.city
i i i i i


FROM employees INNER JOIN offices ON employees.officeCode = offices.officeCode WHE
i i i i i i i i i


RE state = 'CA';
i i i




SELECT firstName, lastName, jobTitle, offices.city FROM employees INNER JOIN offices O
i i i i i i i i i i


N employees.officeCode = offices.officeCode WHERE state = 'NY';
i i i i i i i

, Utilizing SELECT statements, we can narrow down which employees work in California and New Y
i i i i i i i i i i i i i i


ork. The first statement is provided, and the second is fundamentally the same. However, we change o
i i i i i i i i i i i i i i i i


ur desired state in the WHERE clause to attain our second set ofiemployees.
i i i i i i i i i i i i




2. Retrieve order details for orderNumber 10330, 10338, and 10194 and identify what type o
i i i i i i i i i i i i i


ficardinality this represents in the entity relationship model.
i i i i i i i


a.




b. In this model, the relationship between the orders and products tables would be a many
i i i i i i i i i i i i i i


-to-
many relationship. Looking at the three tables, we can determine that orderdetails is a J
i i i i i i i i i i i i i i


OIN with two foreign keys linking to the other tables. Moreover, a customer could have s
i i i i i i i i i i i i i i i


everal orders, and each order could contain multiple products.
i i i i i i i i




3. Delete records from the payments table where the customer number equals 103.
i i i i i i i i i i i


a. First, we identify the fields ofithe payments table by running a simple DESCRIBE state
i i i i i i i i i i i i i


ment.

Información del documento

Subido en
17 de agosto de 2025
Número de páginas
6
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$21.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
NurseAmelia
3.5
(2)
Vendido
14
Seguidores
-1
Artículos
1889
Última venta
3 meses hace


Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes