1. Create three tables a. Customer b. Rent c. Film 2. Define appropriate data type and data size 3. Define column constraints 4. Specify Integrity/Domain/Primary Key/Referential Integrity constraints a. Primary key b. Foreign key E.g.) CONSTRAINT rent_fk_c FOREIGN KEY cid REFERENCES customer ON DELETE CASCADE The price of a film ranges from 0 F0 to 10.00
Q: Given the default schema of a database: Orders 123 Orderld OrderDate ADC OrderNumber 123 Customerld…
A: A Foreign key is a field in a table that is used to reference the Primary key of another table. It…
Q: Create ERD or EERD of a hospital with these requirements: write DB relational schema draw all…
A: answer is
Q: N:M relationships a.) require that the primary key from each table is deleted. b.) require that a…
A: Here is the solution;
Q: 8A-
A: The above given is a default schema of a database.
Q: rite the SQL statements to create all of the necessary tables to represent the above diagram,…
A: Note: Since you have not provided the database name to write the SQL query so I am using the MYSQL…
Q: Describe the concept of a foreign key constraint and how it enforces referential integrity in a…
A: Data integrity is important to ensure that the data is accurate, consistent, and reliable.The key…
Q: Using this unnormalized table and the five functional dependencies and third normal forms. In other…
A: To find the normal forms for the given functional dependencies, we need to check each normal form…
Q: erry must be correct. Refer the attach tables.
A: This has been coded using MySQL.
Q: 35. Key to represent relationship between tables is called a. Primary key b. Secondary Key c.…
A: Please find the answer to the above question below:
Q: Write a CREATE VIEW statement that defines a view named InvoiceBasic that returns three columns:…
A: In the structured query language to form a query, there are three statements used which are select,…
Q: Need to create ERD database ans design for 7 and 8 TABLE P6.7 ATTRIBUTE NAME SAMPLE VALUE SAMPLE…
A: Hey, since multiple questions posted, we will answer first question according to our policy. If you…
Q: Given the default schema of a database:
A: Introduction: SQL queries are the queries that are used in structured query languages just to…
Q: 1-Write the syntax to create a relational table called staff that references an object table called…
A: Syntax for foreign key:- create table tableName(col1 data_type,col2 data_type,…., foreign…
Q: 105. The type of constraint which states that not even a single value with primary key can be a null…
A: Please see the next step for answer.
Q: is the number of attributes/fields in a relation. a. Degree b. Cardinality O c. Tuple d. Row
A: Degree: In DBMS, degree is the number of attributes or column present in the table Cardinality: In…
Q: I'm wondering how to start this assignment?
A: Since it is a SQL assignement, you have to setup your environment for this . Step 1: Download Xampp…
Q: Seminar eminar ID Integer eminar Date Date Seminar Time Time ocation Seminar Title Address String…
A: As the customer may or may not attend the seminar or several seminars, the seminar and the customer…
Trending now
This is a popular solution!
Step by step
Solved in 5 steps
- Task 1 Indexing Implement SQL script solution1.sql that performs the actions listed below. 1. First, the script finds query processing plans for each one of the queries listed below. Use EXPLAIN PLAN statement and a script showplan.sql to display the query processing plans Find all distinct pair of values of receipt-date (L_RECEIPTDATE) and discount (L_DISCOUNT) in the relational table LINEITEM. а. b. Find the total number of rows in the relational table ORDERS where the total price (O_TOTALPRICE) is greater than the average total price (O_TOTALPRICE). Find the total number of ORDERS submitted by each customer, list the values of an attribute O_CUSTKEY together with the total number of orders submitted. Do not ignore customers who submitted no orders. Find the total number of discount (L_DISCOUNT) in the relational table C. d. LINEITEM. е. Find the total number of distinct values in a column O_ORDERPRIORITY in a relational table ORDERS. 2. Next, the script creates the smallest number…Implement a new independent entity phone in the Sakila database. Attributes and relationships are shown in the diagram below The diagram uses Sakila naming conventions. Follow the Sakila conventions for your table and column names: All lower case Underscore separator between root and suffix Foreign keys have the same name as referenced primary key Write CREATE TABLE and ALTER TABLE statements that: Implement the entity as a new phone table. Implement the has relationships as foreign keys in the Sakila customer, staff, and store tables. Remove the existing phone column from the Sakila address table. Step 2 requires adding a foreign key constraint to an existing table. Ex: ALTER TABLE customer ADD FOREIGN KEY (phone_id) REFERENCES phone(phone_id) ON DELETE SET NULL ON UPDATE CASCADE; Specify data types as follows: phone_id, phone_number, and country_code have data type INT. phone_type has date type VARCHAR(12) and contains strings like 'Home', 'Mobile', and 'Other'. Apply these…Implement a new independent entity phone in the Sakila database. Attributes and relationships are shown in the following diagram: The diagram uses Sakila naming conventions. Follow the Sakila conventions for your table and column names: All lower case Underscore separator between root and suffix Foreign keys have the same name as referenced primary key Write CREATE TABLE and ALTER TABLE statements that: Implement the entity as a new phone table. Implement the has relationships as foreign keys in the Sakila customer, staff, and store tables. Remove the existing phone column from the Sakila address table. Step 2 requires adding a foreign key constraint to an existing table. Ex: ALTER TABLE customer ADD FOREIGN KEY (phone_id) REFERENCES phone(phone_id) ON DELETE SET NULL ON UPDATE CASCADE; Specify data types as follows: phone_id, phone_number, and country_code have data type INT. phone_type has date type VARCHAR(12) and contains strings like 'Home', 'Mobile', and 'Other'. Apply…
- How does a foreign key constraint assist in maintaining referential integrity within a database?A prospective key is a component of a composite primary key.- Create dept_manager table with emp_no as primary key and auto increment and not null for other attributes. Ensure the DBMS deletes the referencing rows in the child table when the referenced row is deleted in the parent table which has a primary key. - Show the employee last name, title and order by title in descending order
- What is a foreign key constraint? Why are such constraints important? What is referential integrity?For this problem, the registrar’s office has requested that we create a report of students and the number of courses they have taken to verify minimum graduation requirements. You have been tasked with creating a table and procedure that track this information. To complete this problem: a. create a table (NOT a temporary table) called student_course_nums within the university database schema. b. Write a procedure that accepts a student ID as input. You must name your procedure: __stuCourseNumsProc Where is your last name and is the day of the month you were born. Below is an example of how I named my procedure: Hollers_21_stuCourseNumsProc c. The procedure calculates the total number of course sections attended by that student, and adds a tuple to the student_course_nums table consisting of the student’s ID number, name, and total courses attended - call these attributes: ID, name, and tot_courses. d. If the student already has an entry in the table, then the procedure makes sure the…Joan Yancey has been asked to create a database for her company, Yancey Shipping. The database is to track employees and the special projects to which the employees may be assigned. A special project can have between 2 and 5 employees assigned to it. She has determined that she needs the following tables and fields in her database:(Table 1) Employee Information:Fields - Last Name, First Name, Street Address, City, State, Zip Code, Social Security Number, Phone Number, Hourly Pay Rate, and Project Number (Table 2) Project Information:Fields - Project Number, Project Name, Project Leader, Project Location, Total Hours, and Actual Completion Date What data type should Joan Yancey use for the Actual Completion Date field and why?
- 10. An EMPLOYEES table was added to the JustLee Books database to track employeeinformation. Display a list of each employee’s name, job title, and manager’s name. Usecolumn aliases to clearly identify employee and manager name values. Include allemployees in the list and sort by manager name.pleae eertWhat would be introduced as criteria of a table being in first normal form? a.) There should be no functional dependencies. b.) The primary key of the table should be composed of one column. c.) Each cell of a table should have a single value. d.) Every functional dependency where X is functionally dependent on Y, X should be the super key of the table.