Create  a  table with the  foll columns. nae of employee (NAME, variable character) Date  of birth(DOB, date) Salary  of employee(SALARY,integer) Department(DEPT, variable character)                    [Department :SALE,ACCT,MARKETING]

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter12: Points, Classes, Virtual Functions And Abstract Classes
Section: Chapter Questions
Problem 27SA
icon
Related questions
Question
100%

Create  a  table with the  foll columns.

nae of employee (NAME, variable character)

Date  of birth(DOB, date)

Salary  of employee(SALARY,integer)

Department(DEPT, variable character)

                   [Department :SALE,ACCT,MARKETING]

 

 

10:28
26
_3
Create table Emp with columns (Emp_Id int), (EName varchar(20)), (Age int),
designation (Desg varchar(15)), (Salary dec(9,2)). Enter 7 records.
a. Display all rows.
Insert a new column Address varchar (20) between EName and Age.
c. Supply values for the newly added column and Display all rows.
Give your own queries using where, order by and between clauses.
Sort the rows based on EName.
f. Delete rows where EName starts with a specified letter of your choice and
display the remaining rows.
g. Count number of employees with different age.
h. Display distinct designations.
Count number of employees with different designation.
j. Delete all the rows of this table.
k. See the structure of the table.
1. Delete the table Emp from the database.
e.
i.
********* k
Transcribed Image Text:10:28 26 _3 Create table Emp with columns (Emp_Id int), (EName varchar(20)), (Age int), designation (Desg varchar(15)), (Salary dec(9,2)). Enter 7 records. a. Display all rows. Insert a new column Address varchar (20) between EName and Age. c. Supply values for the newly added column and Display all rows. Give your own queries using where, order by and between clauses. Sort the rows based on EName. f. Delete rows where EName starts with a specified letter of your choice and display the remaining rows. g. Count number of employees with different age. h. Display distinct designations. Count number of employees with different designation. j. Delete all the rows of this table. k. See the structure of the table. 1. Delete the table Emp from the database. e. i. ********* k
Expert Solution
Step 1

Note: - As per the guidelines we can only answer one specific question at a time. Since you have not mentioned the specific question. So I am answering the first one. Please resubmit the second question so that we can help you.

The SQL syntax to create the table, fill the records, and display the records is given below: -

Explanation: -

The CREATE command creates the structure of the table with the given column names.

The INSERT INTO command inserts the records in the table.  

The SELECT command selects the records from the table and display the output.

Step 2

Syntax: -

/* Create a table called EMPLOYEE */

CREATE TABLE EMPLOYEE(Name char, DOB date, SALARY integer, DEPT char);

 

/* Create few records in this table */

INSERT INTO EMPLOYEE VALUES('Tom', '01-12-1999', 12345, 'SALE');

INSERT INTO EMPLOYEE VALUES('Lucy', '21-01-1998', 31233, 'ACCT');

INSERT INTO EMPLOYEE VALUES('Frank', '11-07-1997', 43534, 'SALE');

INSERT INTO EMPLOYEE VALUES('Jane', '15-10-1998', 65454, 'MARKETING');

INSERT INTO EMPLOYEE VALUES('Robert', '16-04-2000', 57655, 'ACCT');

 

/* Display all the records from the table */

SELECT * FROM EMPLOYEE;

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Single Table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning