Database Systems: Design, Implementation, & Management
13th Edition
ISBN: 9781337627900
Author: Carlos Coronel, Steven Morris
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 3, Problem 10P
Program Plan Intro
Primary Key:
A primary key in a
Example:
- Students in Universities are assigned a unique registration number.
- Therefore, in a STUDENT database table, the attribute “reg_no” acts as primary key.
Foreign Key:
Foreign Key is a column in a relational database table which provides a relation between two tables. It provides a cross reference between tables by pointing to primary key of another table.
Example:
- In STUDENT database table, the attribute “reg_no” acts as primary key and in COURSE database table in which the student selects his or her course, the same “reg_no” acts as foreign key for the STUDENT table.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Table name : tblFilm
Attributes: FilmReleaseDate, FilmRunTimeMinutes (For the conditions)
Write a query to increase the budget of all films released between 1933 and 1970 and whose FilmRunTimeMinutes is more than the average FilmRunTimeMinutes by 50%.
From the database scheme write the query(all tables are empty)
1) Insert your name and your phone as a new tenant
2) Delete your phone number from the table tenant.
3) Create a new contract lease for you.
4) Delete the contract that you created.
5) List the city name, city population and country name.
6) List the cities that have the letters “re” in any part of the name;
7) List the tenant name contract number, rent price, when the contract rent price is bigger equal 500 and lower equal 1000.
8) List all columns from apartments with the services offered (all columns from service).
9) List the building address, the city name and the country name for the building in Canada.
10) List the name of the user with the city name and country name, ordering by name of user.
Considering Vaccination Database, write queries to:
Display the Subject CNIC, Name, Contact, Dose1 Center, and Dose2 Center as shown below:
CNIC
Name
Contact
Dose1 Center
Dose2 Center
22401-6645321-1
Nasir
3409991112
Lachi
Kohat 2
14301-6045321-5
Shahab
3409991112
kohat 3
Dara
The subjects who have been vaccinated different types in Dose1 and Dose2. For instance, subjects who were vaccinated ‘Sinovac’ in the first dose, while Pfizer in the second dose.How many Viles of each type have been consumed so far. How many subjects are vaccinated from expired viles. Suggest the name of Incharge for the best performance award based on the highest number of subjects vaccinated on a single day
Chapter 3 Solutions
Database Systems: Design, Implementation, & Management
Ch. 3 - What is the difference between a database and a...Ch. 3 - Prob. 2RQCh. 3 - Prob. 3RQCh. 3 - What are the requirements that two relations must...Ch. 3 - Which relational algebra operators can be applied...Ch. 3 - Explain why the data dictionary is sometimes...Ch. 3 - A database user manually notes that The file...Ch. 3 - Prob. 8RQCh. 3 - Prob. 9RQCh. 3 - Prob. 10RQ
Ch. 3 - Prob. 11RQCh. 3 - Prob. 12RQCh. 3 - Use Figure Q3.13 to answer Questions 1317. FIGURE...Ch. 3 - Create the table that results from applying a...Ch. 3 - Write the relational algebra formula to apply an...Ch. 3 - Create the table that results from applying an...Ch. 3 - Using the tables in Figure Q3.13, create the table...Ch. 3 - Prob. 18RQCh. 3 - Prob. 19RQCh. 3 - Prob. 20RQCh. 3 - Identify and describe the components of the table...Ch. 3 - Identify the primary keys. FIGURE Q3.22 THE...Ch. 3 - Identify the foreign keys. FIGURE Q3.22 THE...Ch. 3 - Create the ERM. FIGURE Q3.22 THE CH03_THEATER...Ch. 3 - Create the relational diagram to show the...Ch. 3 - Prob. 26RQCh. 3 - What would be the conceptual view of the INDEX...Ch. 3 - Prob. 1PCh. 3 - Prob. 2PCh. 3 - Do the tables exhibit referential integrity?...Ch. 3 - Describe the type(s) of relationship(s) between...Ch. 3 - Prob. 5PCh. 3 - Prob. 6PCh. 3 - Prob. 7PCh. 3 - Prob. 8PCh. 3 - Create the relational diagram to show the...Ch. 3 - Prob. 10PCh. 3 - Prob. 11PCh. 3 - Create the relational diagram to show the...Ch. 3 - Prob. 13PCh. 3 - Do the tables exhibit referential integrity?...Ch. 3 - Prob. 15PCh. 3 - Prob. 16PCh. 3 - For each table, identify the primary key and the...Ch. 3 - Prob. 18PCh. 3 - Do the tables exhibit referential integrity?...Ch. 3 - Identify the TRUCK tables candidate key(s). FIGURE...Ch. 3 - For each table, identify a superkey and a...Ch. 3 - Prob. 22PCh. 3 - Prob. 23PCh. 3 - Prob. 24PCh. 3 - Create the ERD. (Hint: Look at the table contents....Ch. 3 - Prob. 26PCh. 3 - Prob. 27PCh. 3 - Prob. 28PCh. 3 - Create the table that would result from applying...Ch. 3 - Create the table that would result from applying...Ch. 3 - Create the table that would result from applying a...
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write the SQL code to calculate the ASSIGN_CHARGE values in the ASSIGNMENT table in the Ch07_ConstructCo database. (See Figure P7.1.) Note that ASSIGN_CHARGE is a derived attribute that is calculated by multiplying ASSIGN_CHG_HR by ASSIGN_HOURS.arrow_forwardDelete the OWNER_INDEX 3 index from the OWNER table.arrow_forwardWhat is the maximum number of PRIMARY KEY constraints allowed for a table? a. 1 b. 2 c. 30 d. 255arrow_forward
- Add two columns to the EMPLOYEES table. One column, named EmpDate, contains the date of employment for each employee, and its default value should be the system date. The second column, named EndDate, contains employees date of termination.arrow_forwardDetermine the functional dependencies that exist in the following table, and then convert this table to an equivalent collection of tables that are in third normal form. LOCATION (LOCATION_NUM, LOCATION_NAME, (UNIT_NUM, SQR_FT, BDRMS, BATHS, CONDO_FEE))arrow_forwardHow is adding a NOT NULL constraint to an existing table different from adding other types of constraints?arrow_forward
- A table can have a maximum of how many PRIMARY KEY constraints?arrow_forwardThe following fields are presented in the table: Member Last Name, MemberFirstName, Street, City, State, ZipCode and MemberFee. The table contains 75,000 documents. How would you build indexes for the table and why would you create these indexes?arrow_forwardCreate the following queries for the “books” database. For each query make sure to only include those tables that are necessary to answer the question. Your answers for each of these questions should consist of the SQL query that will produce these lists, NOT the list itself. For each type of book (e.g. biography, children, etc), show the number of those books that are 450 pages or longer. The column heading should be '# of long books'. Modify the answer to the previous question so that only those types for which there are at least 2 long books are displayed For each publisher, list the name of the publisher and total number of pages that the publisher has published in all their books (ie. add up all the pages in all books for each publisher). Show the publishers who have published the most pages at the top of the result list. Modify the previous query so that only publishers who have published at least 1250 pages will show up. List each publisher's name and the numbers of…arrow_forward
- Please insert the data into the database tablesarrow_forwardYou have the following tables: APARTMENTS (ADDRESS, CITY, STATE, RENTER_ID, RENTER_LAST_NAME) RENTERS (RENTER_ID, FIRST_NAME, LAST_NAME) What is the primary key for the APARTMENTS table? (It may be a composite key involving 2 or more fields) What are the foreign keys, if any? What is the primary key for the RENTERS table? What are the foreign keys, if any? What field in RENTERS can be eliminated so that the RENTERS table is normalized?arrow_forwardcode of create table and insert table only pleasearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781305627482Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningA Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology Ptr
- Database Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781285196145Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos CoronelPublisher:Cengage Learning
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Cengage Learning