Question

1.) Using MS SSMS, create a new query file (sql) and write and execute SQL statements to insert at least five records in each table, preserving all constraints. Put in enough data to demonstrate how the database will function [name the file PopulateDBWithData.sql].

2.) Using MS SSMS, create a new query file (sql) and write SQL statements that will process five non-routine requests for information from the database just created. For each, write the request in English (using the -- [two dashes] before and after the English to turn it into a comment), followed by the corresponding SQL command [name the file DBQueries.sql].

3.) Using MS SSMS, create a new query file (sql) and create at least one trigger and write the code for it [name the file Trigger.sql].

Create Table Patient ( Name (25) (10) (25) (12), (25), (10) (20), (10) (20)); VARCHAR PatientNo CHAR VARCHAR address phone daCreate Table DiagnosisMenu ( diagCode diagName VARCHAR (20), (20)); VARCHAR Create Table ProcedureMenu ( procCode procName (1Create Table Diagnosis ( VisitNo (10) (10) (10) (20) (20) (20)) CHAR diagCode dateOnset СHAR CHAR VARCHAR symptoms severity p

Create Table Patient ( Name (25) (10) (25) (12), (25), (10) (20), (10) (20)); VARCHAR PatientNo CHAR VARCHAR address phone dateOfBirth CHAR VARCHAR VARCHAR VARCHAR sex insuranceCo policyNo relationshipTolnsured CHAR VARCHAR Create Table Appointment ( patientNo apptdate appttime CHAR CHAR (10), (10) (10), (20) (10) (10)); CHAR VARCHAR reason staffNo visitNo CHAR CHAR Create Table Visit VisitNo (10) (10), (10), (10) (20), (20) (20), (10), (10) (10)); CHAR PatientNo visitdate CHAR CHAR visittime CHAR duration VARCHAR VARCHAR reason visitType visitCost staffNo VARCHAR CHAR CHAR roomNo CHAR Create Table Staff ( StaffNo CHAR (10), (20), (20) (20), (10) (7)); VARCHAR name title VARCHAR specialty address phone VARCHAR CHAR CHAR Create Table Availability (10) (10), (10) (10)); staffNo availDate CHAR CHAR startTime endTime CHAR CHAR Create Table InsurancePolicy ( (20) (10), (20), (20), (10), (10) (10) (10) (10)); VARCHAR company policyNo insuredName СHAR VARCHAR VARCHAR CHAR policytype medicalCoPay labCoPay pharmacyCoPay startDate endingDate CHAR CHAR CHAR CHAR
Create Table DiagnosisMenu ( diagCode diagName VARCHAR (20), (20)); VARCHAR Create Table ProcedureMenu ( procCode procName (10) (20) (10)); CHAR VARCHAR CHAR cost Create Table Room ( roomNo CHAR (10), (20), (20)); roomType VARCHAR condition VARCHAR Create Table PrescriptionScript ( scriptNo (10) (10) (10) (20), (10), (20), (10)); CHAR visitNo CHAR date Written CHAR itemPrescribed VARCHAR quantityPrescribed directions numberRefills CHAR VARCHAR CHAR Create Table LabTest ( (10) (10) testNo CHAR prescriptionNo textType testDate CHAR VARCHAR (20), (10), (10) (10), (20)) CHAR testTime CHAR CHAR cost VARCHAR result Create Table PrescriptionMedication (10) (10), (20), (10), (10) (10), (10)); RXNumber СHAR scriptNo drugDispensed dateDispensed quantityDispensed refillsRemaining CHAR VARCHAR СHAR CHAR CHAR CHAR cost Create Table ProcedurePerformed ( visitNo CHAR (10), (10) (20)) procCode result CHAR VARCHAR
Create Table Diagnosis ( VisitNo (10) (10) (10) (20) (20) (20)) CHAR diagCode dateOnset СHAR CHAR VARCHAR symptoms severity prognosis VARCHAR VARCHAR Create Table Referral ( refNo (10) (10) (20), (20) CHAR visitNo CHAR refTo VARCHAR VARCHAR reason Create Table Bill ( invoiceNo СHAR (10), (10), (10) (10) (10) (10)); billDate CHAR CHAR totalAmount dueDate СHAR patientNo amountPaid СHAR CHAR Create Table Charge ( (10) (20) (10) (10); invoiceNo CHAR serviceType serviceDate VARCHAR СHAR amountCharged СHAR Create Table Payment ( (10) (10), (10) (20) (20), (10)); invoiceNo CHAR date CHAR amountPaid CHAR patientPayer insuranceCoPayer insurancePolNoPayer VARCHAR VARCHAR CHAR
0 0
Add a comment Improve this question Transcribed image text
Answer #1

There are total 4 classes. Student class is inherited and publicly accessed by 2 more classesFirstYearStudent and SecondYearStudent and there is 1 more School class. So total 4 classes

In main function when School object is called 100 constructors from FirstYearStudent of Student and 100constructors from SecondYearStudent of Student and 1 of school constructor and 100 constructor of FirstYearStudent itself and 100 constructors of SecondYearStudent which means s a total of 401 objects will be created because 401 will be created.

Add a comment
Know the answer?
Add Answer to:
1.) Using MS SSMS, create a new query file (sql) and write and execute SQL statements...
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
  • Question for SQL in MS SQL Server Management Studio (Please don't use where clause for Joins...

    Question for SQL in MS SQL Server Management Studio (Please don't use where clause for Joins use from clause) Need to Create a Query to display products purchased by customers in Germany that were not purchased by customers in the US. Customers PK Customer D CompanyName Contact Name Contact Title Address City State OrRegion PostalCode Country Phone char(5) varchar(40) varchar(30) varchar(30) varchar(60) varchar(15) varchar(15) varchar(10) varchar(15) varchar(24) varchar(24) Order Details Orders PK OrderID int FK CustomerlD char(5) FK Employeeld int...

  • Question for SQL in MS SQL Server Management Studio (Please don't use where clause for Joins...

    Question for SQL in MS SQL Server Management Studio (Please don't use where clause for Joins use from clause) Need to Create a Query because Northwind Traders has decided to increase their retail prices. Write a query that shows the product name, the current price, and the new price. Make sure the new price is listed to 2 decimal points. Follow below guidelines on new retail price: a.         If the category is beverages or dairy products, increase the price by...

  • Question for SQL in MS SQL Server Management Studio (Please don't use where clause for Joins...

    Question for SQL in MS SQL Server Management Studio (Please don't use where clause for Joins use from clause) Need to Create a Query because Northwind Traders wants to make sure that all orders are shipped within 10 days. Display any orders that were not shipped within 10 days. Include the OrderID, the OrderDate, and the number of days it took before the order was shipped. Customers PK Customer D CompanyName Contact Name Contact Title Address City State OrRegion PostalCode...

  • For each question, write a SQL query and save it as a "sql" file using a...

    For each question, write a SQL query and save it as a "sql" file using a different query 2, etc. Please execute these queries sequentially name, for example, query1.query product id (PK) category brand production_cost (Not Null) (FK) name (Not Null) Toothpaste Supermarket 1 Multivitami Supermarket 2 Shampoo acket T-shirt Supplements Supermarket Department4 Department5 Pharmacy Pharmacy 6 6 10 Query1. Update the Product table by adding another column as shown above ucts (name) with uery2. Retrieve all the uction cost...

  • Step 1: Create table audits via triggers The system must log any insertion, deletion, or updates...

    Step 1: Create table audits via triggers The system must log any insertion, deletion, or updates to the following tables: • Employee table (project 1) create table Employee ( empNumber char(8) not null, firstName varchar(25) null, lastName varchar(25) null, ssn char(9) null, address varchar(50) null, state char(2) null, zip char(5) null, jobCode char(4) null, dateOfBirth date null, certification bit null, salary money null, constraint PK_EMP PRIMARY KEY(empNumber), constraint EMP_STATECHECK CHECK(state in ('CA','FL')) ) GO • Job table (project 1) create...

  • Connect to mySQL DBMS, open a SQL script file, navigate to CityJail.sql file and execute it...

    Connect to mySQL DBMS, open a SQL script file, navigate to CityJail.sql file and execute it to create tables and populate with the supplied data. If there are any errors in the script fix them. It is your job to find the errors and correct them. This is important. You will need correct data for future exercises in this module. Then answer all questions. Write the answer below each question then take screen shot of the result. This script builds...

  • already created table now need php and html Write SQL statements to delete the above table....

    already created table now need php and html Write SQL statements to delete the above table. 3. PHP with html Write the html code to allow a user to enter a SUP_ID from the sunnysdiner database available on the same scrver. Then write the separate file with PHP script should display all the supplier's information from the supplier table with proper error handling. html file: a) use sunnysdiner; CREATE TABLE supplier ( food_item varchar(30) not null primary ley, SUP_ID INT,...

  • SQL Query Question: I have a database with the tables below, data has also been aded...

    SQL Query Question: I have a database with the tables below, data has also been aded into these tables, I have 2 tasks: 1. Add a column to a relational table POSITIONS to store information about the total number of skills needed by each advertised position. A name of the column is up to you. Assume that no more than 9 skills are needed for each position. Next, use a single UPDATE statement to set the values in the new...

  • Database HW help!!!!!!! Provide the SQL statements for the following queries. (1) Provide the names and...

    Database HW help!!!!!!! Provide the SQL statements for the following queries. (1) Provide the names and phones of all swimmers currently in level (of id) 3. +-------+---------+---------------------------+ | FName | LName   | EMail                     | +-------+---------+---------------------------+ | Bobby | Khan    | theBKhan1 | | Clara | Johnson | ClaraJohnson_11 | +-------+---------+---------------------------+ 2 rows in set (0.00 sec) (2) Provide the names of swimmers who have signed up to participate in the event '100M Butterfly' of Meet id 1. +-------+---------+ | FName...

  • SQL Command - Create a view called S LIST that lists the Cardholder Number, last name,...

    SQL Command - Create a view called S LIST that lists the Cardholder Number, last name, first name and due date for all cardholders who have not returned a book. Use the CREATE OR REPLACE VIEW AS ... command. TABLE CARD HOLDERS Cardholder Numberint NOT NULL CONSTRAINT CH PK PRIMARY KEY, First_Name varchar(10) NULL, LastName varchar(15) NULL, Address varchar(20) NULL, varchar(15) NULL, State char(2) NULL, Zip_Code char(5) NULL) City TABLE BOOKS CHECKED OUT Cardholder_Numberint NOT NULL, Book Numberint NOT NULL,...

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