Lab_1_Jada Akins

pdf

School

University of Indianapolis *

*We aren’t endorsed by this school

Course

663

Subject

Computer Science

Date

Apr 3, 2024

Type

pdf

Pages

4

Uploaded by akins6312

Report
DBST663 Homework Assignment #1: Questions. Please answer the following questions. 1. (60%) Now you have the following 6 SQL questions. You have to build your query and take a screenshots of the query result: a. Query all owners in the Lab1_Owners Table b. Query all SalesOffices in CA SELECT * FROM lab1_salesoffice where location = 'CA'
c. Query all properties in DC SELECT * FROM lab1_properties where state = 'DC' d. Query all properties along with the sales manager responsible for the SalesOffice that sold the Properties SELECT * FROM lab1_properties left join lab1_salesoffice on lab1_salesoffice.office_manager=lab1_salesoffice.office_manager
e. Query Percent Owned table to determine who owns 100% of a property SELECT percentowned from lab1_percentowned order by owner_id f. What Owner is serviced by what Office Manager? (Four Table Join!) SELECT owner_name, lab1_properties.property_id, lab1_salesoffice.office_manager, lab1_salesoffice.location from lab1_owner inner join lab1_salesoffice on lab1_salesoffice.office_manager=lab1_salesoffice.office_manager INNER JOIN lab1_properties on lab1_properties.property_id=lab1_properties.property_id inner join lab1_salesoffice on lab1_salesoffice.location=lab1_salesoffice.location
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
2. (20%) a. What are entity and referential integrity? Answer: Entity integrity ensures that each row in a database table is unique and identifiable by a primary key. Referential integrity ensures that relationships between tables remain consistent, meaning a foreign key in one table must match a primary key in another table or be null. b. Why are entity and referential integrity important in a database? One paragraph up to 4 lines should be good enough to answer the questions. Answer: Entity and referential integrity are crucial in a database to maintain data accuracy and consistency. Entity integrity ensures that each record is unique and identifiable, preventing duplicate entries. Referential integrity maintains the logical relationships between tables, ensuring that data in one table corresponds correctly to data in another. Together, they help preserve the reliability and integrity of the database, preventing errors and data anomalies that could lead to incorrect information or system failures. 3. (20%) Can you describe what are 1NF, 2NF and 3NF normalization in DB? One paragraph up to 4 lines should be good enough to answer the questions. Answer: Normalization in databases is a process to organize data to reduce redundancy and improve data integrity. The first normal form (1NF) ensures that each column in a table contains atomic values, meaning each cell holds only a single value. The second normal form (2NF) requires that the table is in 1NF and that all non-key attributes are fully functionally dependent on the primary key, eliminating partial dependencies. The third normal form (3NF) builds on 2NF by ensuring that all non-key attributes are not only fully functionally dependent on the primary key but also independent of each other, removing transitive dependencies. Together, these forms help create a more efficient and reliable database structure.