Concept explainers
Getting this error when adding the parts table: Msg 8110, Level 16, State 0, Line 1 Cannot add multiple PRIMARY KEY constraints to table 'Service_Parts'.
Getting similar errors for the other tables....The first 2 had no errors but the others have errors.........Here is the code which contains errors..... CREATE TABLE Service_Parts( Part_Number int NOT NULL, Service_ID VARCHAR(80), PRIMARY KEY (Service_ID), PRIMARY KEY (Part_Number), FOREIGN KEY (Part_Number ) REFERENCES Part(Part_Number), FOREIGN KEY (Service_ID) REFERENCES ServiceRecordCalender(Service_ID) ); ServiceRecordCalender Table: CREATE TABLE ServiceRecordCalender( Service_ID VARCHAR(80), DateCalled DATE, DateOfService DATE, Serial_Number int NOT NULL, Technician_ID int NOT NULL, PRIMARY KEY (Service_ID ), FOREIGN KEY (Technician_ID ) REFERENCES Technician(Technician_ID ), FOREIGN KEY (Serial_Number ) REFERENCES Appliance(Serial_Number ), FOREIGN KEY (DateOfService ) REFERENCES Technician(DateOfService ) ); Technician Table: CREATE TABLE Technician( Technician_ID int NOT NULL, DateOfService DATE, OrderParts VARCHAR(80), PRIMARY KEY (Technician_ID) );
Primary key is among one of the most important constraints in databases. A primary key is used to identify each record present in a table uniquely.
Step by stepSolved in 2 steps
- Task 6: The Car Maintenance team considered that the available maintenance tasks should also have the price information in the database. Alter the MAINTENANCE_TYPES table to include a new column named MAINTENANCE_PRICE of type FLOAT. ANSWER IN MYSQL PLEASEarrow_forwardUnder what circumstances should you not create an index for a table?arrow_forwardWrite a select statement for the following: Join all the tables of the lunches database together (Anything table starting with L_). Show all the columns of each table. To do this, modify the select statement in this section and add the three other tables to it. How many rows and columns are in this table?arrow_forward
- For this problem create a (temporary) table called instructor_course_nums. Write a procedure that accepts an instructor ID as input. The procedure calculates the total number of course sections taught by that instructor, and adds a tuple to the temporary table consisting of the instructors ID number, name, and total courses taught - call these attributes: ID, name, and tot_courses. If the instructor already has an entry in the table,then the procedure makes sure the total number of courses taught in the temporary table is up-to-date. You must name your procedure: Written in PostgreSQLarrow_forwardTo obtain the structure of an Oracle table, the command to use is: a) STRUCTURE [TableName]. b) DESCRIBE [TableName]. c) DESCRIBE STRUCTURE [TableName]. d) DESC TABLE [TableName].arrow_forwardHow do we decide which model to create in Microsoft Access as our table creation environment?arrow_forward
- !I am doing all this from cengage! Task 10: List all the tables contained within the system catalog, but only display the first 10 records with a TABLE_TYPE of SYSTEM VIEW. I did with: SELECT * FROM (SELECT * from KimTay) WHERE ROWNUM <= 11; and with: SELECT * FROM (SELECT TABLE_NAME FROM ALL_TABLES ORDER BY TABLE_NAME ) WHERE ROWNUM <= 10; and with: SELECT * FROM SYSTABLES but nothing worked and some of them gave me an error as (ERROR 1248 (42000) at line 1: Every derived table must have its own alias) and I need answers for these too: Task 11: List all the columns contained within the system catalog, but only display the first 11 records that are in the KimTay TABLE_SCHEMA. Task 12: List all the views contained within the system catalog, but only display the first 12 records. Task 13: Write the command to display only tables within the system catalog that have the KimTay TABLE_SCHEMA and are of the type BASE TABLE. Display only the following columns:…arrow_forwardCreate a view vLab3_xxx in the class database list the staff who have the highest salary in each of the branch city. You will need both Staff and Branch table. The output header should be (city, name, salary) where the name is "fname lname".arrow_forwardHi triggers Update and using Xampp and this table: CREATE TABLE MEMBER(STUDENT_ID CHAR(6) NOT NULL,CLUB_CODE VARCHAR(4) NOT NULL,MEMBER_DATE DATE NOT NULL,MEMBER_POSITION VARCHAR(15) NOT NULL,MEMBER_ATTENDANCE CHAR(2) NOT NULL,PRIMARY KEY (STUDENT_ID,CLUB_CODE),FOREIGN KEY (STUDENT_ID) REFERENCES STUDENT (STUDENT_ID) ON DELETE RESTRICT ON UPDATE CASCADE,FOREIGN KEY (CLUB_CODE) REFERENCES CLUB (CLUB_CODE) ON DELETE RESTRICT ON UPDATE CASCADE); INSERT INTO MEMBER VALUES('100027','C201','2020-03-25','Secretary','12'),('100027','C202','2020-04-11','Member','11'),('100032','C201','2020-02-23','President','12'),('100050','C201','2020-03-25','Member','10'),('100132','C202','2020-04-11','Treasurer','10'),('100074','C203','2020-04-09','President','12'),('100074','C204','2020-04-25','Treasurer','12'),('100051','C204','2020-04-25','Member','9'),('100064','C207','2020-04-25','Vice…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education