Question

In: Computer Science

7. Use the substitution & method of INSERT command to populate EMP_PROJ table. INSERT INTO EMP_PROJ...

7. Use the substitution & method of INSERT command to populate EMP_PROJ table. INSERT INTO EMP_PROJ VALUES (‘&empNo’, ‘&projNo’, &hoursWorked); NOTE: enclose &empNo in ‘ ‘ if the datatype is a string – VARCHAR2 or CHAR If empNo is NUMBER datatype then do not enclose &empNo in ‘ ‘!

empNo

projNo

hoursWorked

1000

30

32.5

1000

50

7.5

2002

10

40.0

1444

20

20.0

1760

10

5.0

1760

20

10.0

1740

50

15.0

2060

40

12.0

Solutions

Expert Solution

I have created an empty table of emp_proj assuming that the empNo is number(10)
projNo is number and hoursWorked number.

For creating a table I have used the below command
create table EMP_PROJ (empNo number(10), projNo number(10), hoursWorked number(10,1));


Command to insert data into EMP_PROJ table using the substitution method
insert into EMP_PROJ values (&empNo,&projNo,&hoursWorked);

Execute this command as many times the number of rows to be inserted. Each time it prompts us to enter the three columns, enter the data respectively

To view the data in EMP_PROJ table.


If empNo is taken as varchar then create table command would be
create table EMP_PROJ (empNo varchar2(10), projNo number(10), hoursWorked number(10,1));

Command to insert data into EMP_PROJ table using the substitution method :
insert into EMP_PROJ values ('&empNo',&projNo,&hoursWorked);

Execute this command as many times the number of rows to be inserted. Each time it prompts us to enter the three columns, enter the data respectively.

Note that we have given quotes for the empNo while inserting as the data type is varchar.



Related Solutions

Write CREATE TABLE and INSERT INTO statements in order to create and populate five tables in...
Write CREATE TABLE and INSERT INTO statements in order to create and populate five tables in Oracle’s SQL*Plus.The information you need about the database ARE IN THE CHARTS BELOW. Each worksheet includes the following information about its associated table: ➢ Column names (for example, the jr_order table contains the orderID, customerID, orderDate, orderStatus, and orderShippedDate columns); ➢ Column data types (for example, orderID is INT, orderStatus is VARCHAR2(2), etc.); ➢ Column constraints, if any (for example, orderID in the jr_order...
Homework: Populate Sales Order tables. Write SQL to : 1. insert 5 records in each table:...
Homework: Populate Sales Order tables. Write SQL to : 1. insert 5 records in each table: Market, Region, ProductFamily, Manager (all Managers must have different % commissions, Commission is an attribute of the Manger). 2. Insert 5 records in Agent using all Managers 3. Insert 15 records in Product using  all ProductFamily 4. Insert 15 records in Customer using various Regions and Markets 5. Insert 50 records in SalesOrder using various Customers, Products, Agents Notes : ALL the Names ( Description)...
Add your own method (or use one or more of the existing methods) to insert the...
Add your own method (or use one or more of the existing methods) to insert the following set of numbers (1, 5, 19, 7, 23, 17, 2) in a linked list (use one function-call per number, and preserve the order of insertion). Once inserted print the linked list such that the output displays the numbers in reverse order. (2, 17, 23, 7, 19, 5, 1) JAVA CODE BELOW class aNode { char data; aNode next; aNode(char mydata) { // Constructor...
Using Python, write a segment of code to populate the table "employee" of the database "EmployeeDB”...
Using Python, write a segment of code to populate the table "employee" of the database "EmployeeDB” with the data below. Import your choice of DB connector (import MySQLdb/sqlite3…) Create the“employee” table with schema = [name, address, age] Insert this employee: John Doe, 7001 E Williams Field, 32
- What SQL command would you use to make a table for products that includes three...
- What SQL command would you use to make a table for products that includes three columns: a product’s ID, a product’s cost, and a product’s selling price? - What SQL command would you use to make a table for telephone directory that contains a person’s full name, a person’s cellphone number, and a person’s home phone number? - What SQL command would you use to make a table for an inventory of network equipment that includes the following: the...
Using recursion find the answer to do the question below, Use the derivation and substitution method....
Using recursion find the answer to do the question below, Use the derivation and substitution method. 3.t(n) = 6t(n-1) + 4t(n-2) +4(3^n)
**Need to use awk command in putty (should be a ONE LINE COMMAND) Write the command...
**Need to use awk command in putty (should be a ONE LINE COMMAND) Write the command that would find all lines that have an email address and place a label email = before the line in the file longfile output will multiple lines similar to this one : using a good awk command the output would be something like this email = From: "Linder, Jann/WDC" <[email protected]> email = To: Mr Arlington Hewes <[email protected]> email = > From: Mr Arlington Hewes...
Create a Word document and title it “College Expenses”. In the Word document, insert a table with at least 5 rows and 5 columns. Insert>Table.
Assignment 3 – Incorporating a Table into a Document.Create a Word document and title it “College Expenses”. In the Word document, insert a table with at least 5 rows and 5 columns. Insert>Table.Tell me about your college expenses you have by filling this table with subjects and data. Then write two paragraphs telling me about the information you provided in the table. Bold and color table heading.  Example of table:College ExpensesTuitionBooksComputer/InternetOther suppliesScience ClassMath classC.I.S. ClassEnglish ClassGive the page a proper title....
How to populate an SQL table that has two PK (foreign) that have different number of...
How to populate an SQL table that has two PK (foreign) that have different number of rows? Example: there are 3 tables. student, assigment, and hoursDedicated. there are 5 students, and 3 assigments, and x hoursDedicated. hoursDedicated has 2 Primary Keys, studentID and assigmentID. how do you populate hoursDedicated?? Thank you for your time.
Write a MATLAB script file to integrate  using trapezoid method (do not use trapz command for this...
Write a MATLAB script file to integrate  using trapezoid method (do not use trapz command for this part, write your own script). Consider x=-0.5 to 3 with Δt=0.01, and compare your result with using “integral” and "trapz" commands (all in one file).
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT