Question: need code in mySQLprogram Problem 1.1: Create a database called lab assignment 1. Answer: Problem 1.2: Create a table called EMP with the following structure.

need code in mySQLprogram
 need code in mySQLprogram Problem 1.1: Create a database called lab
assignment 1. Answer: Problem 1.2: Create a table called EMP with the
following structure. Name EMPNO ENAME JOB MGR DEPTNO SAL Type INT (6)
VARCHAR(20) VARCHAR(10) NUMERIC (4) NUMERIC (3) NUMERIC (8,2) Allow NULL for all

Problem 1.1: Create a database called lab assignment 1. Answer: Problem 1.2: Create a table called EMP with the following structure. Name EMPNO ENAME JOB MGR DEPTNO SAL Type INT (6) VARCHAR(20) VARCHAR(10) NUMERIC (4) NUMERIC (3) NUMERIC (8,2) Allow NULL for all columns except ENAME and JOB. Answer: Problem 1.3: Add a column COMMISSION which can hold NULL value. Note: 1. Define the new column and its data type. 2. Use the alter table syntax. Answer: Problem 1.4: Modify the column width and data type of the JOB field of EMP table. Note: 1. Use the alter table syntax. 2. Modify the column width and its data type. Answer: Problem 1.5: Create DEPT table with the following structure. NAME DEPTNO DNAME LOC TYPE NUMERIC (2) VARCHAR(10) VARCHAR(10) DEPTNO as the PRIMARY KEY Note: 1. Use the create table syntax to create the said tables. Answer: Problem 1.6: Add constraints to the EMP table that EMPNO as the PRIMARY KEY. Note: 1. Use the alter table syntax for adding constraints. Answer: Problem 1.7: Add constraints to the EMP table to check the EMPNO value while entering (i.e) EMPNO > 100. Note: 1. Use the alter table syntax for adding constraints

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!