Question

sai veterent Course it ACCT 321 etro te Accounbsg 333 o Grade 168301458 A , wierna [204 し5432910) 41291073 | ACCT 131

Please help

media%2F9a0%2F9a0e18d7-e898-43e1-9da4-ed

Write the SQL statements necessary to complete the following tasks:

a) Use the ERD and provided data to create the four tables.

b) Insert the provided data into each of the four tables.

c) Update InstructorLoc for Instructor 111 to DA 206.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

drop table student cascade constraints;
drop table instructor cascade constraints;
drop table course cascade constraints;
drop table courseGrade cascade constraints;


create table STUDENT(StudentID int primary key,
                       Firstname varchar(20),
                       lastname varchar(20),
                       CampusAddress varchar(20),
                       Major varchar(10));
                      
create table instructor(InstructorID int primary key,
                       Firstname varchar(20),
                       lastname varchar(20),
                       InstructorLoc varchar(20));
                      
                      
create table course (CourseId varchar(20) primary key,
                   CourseTItle varchar(30),
                   InstructorId int,
                   foreign key(InstructorId) references instructor(InstructorId));
                  
                  
create table CourseGrade(StudentId int,
                       CourseID varchar(20),
                       Grade Varchar(4),
                       Primary key(StudentId,CourseID),
                       foreign key(StudentId) references Student(StudentId),
                       foreign key(courseid) references Course(courseID));
                      
insert into student values(168300458,'Ean','William','208 Hillker','IS');
insert into student values(543291073,'Wan','Baker','112 Claurence','ACCT');

                      
insert into instructor values(111,'David','Lite','DA 230');
insert into instructor values(222,'Robert','Miller','DA 233');
insert into instructor values(333,'Ail','Ajma','PTC 205');
insert into instructor values(444,'Baria','Kerker','PTC 310');

                  
insert into Course values('IS 370','Bussiness Programming1',111);
insert into Course values('IS 372','System ANalysis',222);
insert into Course values('ACCT 121','Intro to Accounting',333);
insert into Course values('ACCT 230','Managirial Accounting',444);

                      
insert into CourseGrade values(168300458,'IS 370','A');                      
insert into CourseGrade values(168300458,'IS 372','B+');                      
insert into CourseGrade values(543291073,'IS 372','C');                      
insert into CourseGrade values(543291073,'ACCT 121','B');                      
insert into CourseGrade values(543291073,'ACCT 230','A');
          

select * from student;
select * from course;
select * from instructor;
select * from courseGrade;

update Instructor set InstructorLoc='DA 206' where InstructorId=111;
select * from instructor;

SQL> SQL> select*From student; STUDENTID FIRSTNAME LASTNAME CAMPUSADDRESS MAJOR William Baker 208 Hİİlker IS ACCT 168300458 E

SQL> update Instructor set InstructorLoc=DA 206 Instructor|d=111; where 1 row updated. SQL> select from instructor; LASTNAM

Add a comment
Know the answer?
Add Answer to:
Please help Write the SQL statements necessary to complete the following tasks: a) Use the ERD...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • need help Create or edit the SQL statements required to accomplish the following tasks. All columns...

    need help Create or edit the SQL statements required to accomplish the following tasks. All columns should have a column name, feel free to create appropriate aliases Use screen shots to ca evidence that each task is completed; include the SQL records before and after statements are executed, as appropriate. Include all work, even if you get errors. Paste your screen shots into a single PowerPoint file pture statements output from the statements, and views of the object explorer when...

  • 1. Create a PL/SQL program block that determines the top students with respect to GPA. Assume...

    1. Create a PL/SQL program block that determines the top students with respect to GPA. Assume that the database has four tables. Student(SSN, SName, DOB, Major) , Grade(SSN, CNo, Grade(0,1,2,3,4)) and Course table(CNo,CName, Credit Hour), Prerequisite(CNo, PreCNo); Student and couse data ae given in the following SQL statements a. Accept a number n as user input with SQL*Plus telling top n%. b. In a loop get the SName and GPA of the top n% people with respect to GPA. c....

  • Use the SQL statements provided to create your tables. Write one SQL statement for each of...

    Use the SQL statements provided to create your tables. Write one SQL statement for each of the following problems. You can only use the conditions listed in the tasks. E.g., in task 1, you cannot manually look up pid of Information Systems undergraduate program. Here is the given code: drop table textbook_schedule cascade constraints; drop table textbook_author cascade constraints; drop table schedule cascade constraints; drop table course cascade constraints; drop table textbook cascade constraints; drop table author cascade constraints; drop...

  • Please write ONE SQL statement for each of the following tasks using the below tables. Note...

    Please write ONE SQL statement for each of the following tasks using the below tables. Note that you can only use conditions specified in the task description and cannot manually look up data and add conditions. Task 1: return title of textbooks with price over $100. Task 2: return number of courses sections scheduled for each year and semester. Please return year, semester, and number of courses. Task 3: Return names of all courses in Information Systems undergraduate program. Task...

  • SQL CODE – System Variables System variables can be set via the command line. Please write a sequence of statements to: Set safe updates to false for the session. Do the following at the global level...

    SQL CODE – System Variables System variables can be set via the command line. Please write a sequence of statements to: Set safe updates to false for the session. Do the following at the global level: Set the maximum number of connections to 45. Set the threshold for long running queries to 7 seconds – do this at the global level. Set logs to expire when they are more than 3 days old Write the commands to display the value...

  • Question 1.Write a SQL statement for each of the following questions based on the above tables...

    Question 1.Write a SQL statement for each of the following questions based on the above tables (50 Points). 1) Create “Enrollment” table. 2) Change the credits of “Database” course from 2 to 3. 3) List the course titles (not Course_No) and grades John Doe had taken. 4) Calculate average of Café Balance, and name new field as Average Balance. 5) Create a roster for “Database” course (list student ID, last name, first name, major, and status for each student enrolled...

  • Overview This lab provides you the opportunity to insert and update data with the use of SQL comm...

    Overview This lab provides you the opportunity to insert and update data with the use of SQL commands. The lab will utilize the FLIX2YOU problem, the current schema. In order to start this lab, you must have successfully completed Lab # 6. In Lab # 6, you executed a script that was provided to you. This script created 7 of the FLIX2YOU tables as documented in the Entity Relationship Diagram in the FLIX2YOU problem document. The second part of lab...

  • Database Intro Salesmen Sheet Order_info Sheet Business_Info sheet 1.Create your own table design based on the...

    Database Intro Salesmen Sheet Order_info Sheet Business_Info sheet 1.Create your own table design based on the Excel data, and include all relationships (joins). Apply referential integrity rules wherever appropriate. Import the data from Excel to Access to populate tables: 1. Use the Chen technique and illustrate the E-R diagram for the tables you created Note: It may be necessary to change the data composition due to normalization issues, if you change the composition detail how and why; (you may find...

  • i need help please it cover my major part of grades please its a request i...

    i need help please it cover my major part of grades please its a request i have few journal entries Because Natalie has had such a successful first few months, she is considering other opportunities to deve is the sale of fine European juicing machines. The owner of Kzinski Supply Co. has approached Natalie tot distributor of these fine juicers. The current cost of a juicer is approximately $525 Canadian, and Natalie Inventory is recorded using the perpetual method. In...

  • HELP needed urgently....Data and question is attacted below..... Thank you in advance there is no data...

    HELP needed urgently....Data and question is attacted below..... Thank you in advance there is no data link fir this data it’s all in photos.... thank you i have already posted the question We were unable to transcribe this imageNo. 2 3 4 5 6 7 8 Working Sector Public Own Public Public Private Public Private Private Own Own Private Public Public Public Private 9 10 11 12 13 Public IS 16 17 18 19 20 21 22 23 24 25...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT