Write a SQL statement that converts a number value to a character
<ol><li>Write a SQL statement that converts a number value to a character.</li><li>Write a
SQL statement that converts a date datatype to a char datatype.</li><li>Write a SQL statement that uses the CAST function that converts a number datatype to a varchar datatype.</li><li><span style=”color:#000000;”>Check if any of the phone numbers in the INSTRUCTOR table have not been entered in the (###)###-#### format. Show the instructor last name and the phone number that is in the incorrect format.</span></li></ol> ATTACHMENT PREVIEW Download attachmentDROP TABLE IF EXISTS EMP;DROP TABLE IF EXISTS DEPT;DROP TABLE IF EXISTS BONUS;DROP TABLE IF EXISTS SALGRADE;DROP TABLE IF EXISTS DUMMY;DROP TABLE IF EXISTS STUDENT;DROP TABLE IF EXISTS INSTRUCTOR;DROP TABLE IF EXISTS COURSE;DROP TABLE IF EXISTS ENROLLMENT;DROP TABLE IF EXISTS SECTION;DROP TABLE IF EXISTS ZIPCODE;CREATE TABLE EMP(EMPNO INTEGER NOT NULL,ENAME VARCHAR(10),JOB VARCHAR(9),MGR INTEGER ,HIREDATE DATE,SAL INTEGER ,COMM INTEGER ,DEPTNO INTEGER );INSERT INTO EMP VALUES(7369, ‘SMITH’,’CLERK’, 7902,’1980-12-17′,800, NULL, 20);INSERT INTO EMP VALUES(7499, ‘ALLEN’,’SALESMAN’,7698,’1981-02-20′,1600,300, 30);INSERT INTO EMP VALUES(7521, ‘WARD’,’SALESMAN’,7698,’1981-02-22′,1250,500, 30);INSERT INTO EMP VALUES(7566, ‘JONES’,’MANAGER’,7839,’1981-04-02′,2975, NULL, 20);INSERT INTO EMP VALUES(7654, ‘MARTIN’, ‘SALESMAN’,7698,’1981-05-01′,1250, 1400, 30);INSERT INTO EMP VALUES(7698, ‘BLAKE’,’MANAGER’,7839,’1981-06-09′,2850, NULL, 30);INSERT INTO EMP VALUES(7782, ‘CLARK’,’MANAGER’,7839,’1981-06-09′,2450, NULL, 10);INSERT INTO EMP VALUES(7788, ‘SCOTT’,’ANALYST’,7566,’1982-12-09′,3000, NULL, 20);INSERT INTO EMP VALUES(7839, ‘KING’,’PRESIDENT’, NULL,’1981-11-17′,5000, NULL, 10);INSERT INTO EMP VALUES(7844, ‘TURNER’, ‘SALESMAN’,7698,’1981-09-08′,1500,0, 30);INSERT INTO EMP VALUES(7876, ‘ADAMS’,’CLERK’,7788,’1983-01-12′,1100, NULL, 20);INSERT INTO EMP VALUES(7900, ‘JAMES’,’CLERK’,7698,’1981-12-03′,950, NULL, 30);INSERT INTO EMP VALUES(7902, ‘FORD’,’ANALYST’,7566,’1981-12-03′,3000, NULL, 20);INSERT INTO EMP VALUES(7934, ‘MILLER’, ‘CLERK’,7782,’1982-01-23′,1300, NULL, 10);CREATE TABLE DEPT(DEPTNO INTEGER,DNAME VARCHAR(14),LOC VARCHAR(13) );INSERT INTO DEPT VALUES (10, ‘ACCOUNTING’, ‘NEW YORK’);INSERT INTO DEPT VALUES (20, ‘RESEARCH’,’DALLAS’);INSERT INTO DEPT VALUES (30, ‘SALES’,’CHICAGO’);INSERT INTO DEPT VALUES (40, ‘OPERATIONS’, ‘BOSTON’);CREATE TABLE STUDENT(STUDENT_ID INT COMMENT ‘The unique ID for a student.’
View the Answer,SALUTATION VARCHAR(5) COMMENT ‘The student”s title (Ms., Mr., Dr., etc.).’,FIRST_NAME VARCHAR(25) COMMENT ‘This student”s first name.’,LAST_NAME VARCHAR(25) COMMENT ‘This student”s last name.’,STREET_ADDRESS VARCHAR(50) COMMENT ‘The student”s street address.’,ZIP VARCHAR(5) COMMENT ‘The postal zip code for this student.’,PHONE VARCHAR(15) COMMENT ‘The phone number for this student including areacode.’,EMPLOYER VARCHAR(50) COMMENT ‘The name of the company where this student isemployed.’,REGISTRATION_DATE DATETIME COMMENT ‘The date this student registered in theprogram.’,CREATED_BY VARCHAR(30) COMMENT ‘Audit column – indicates user who inserteddata.’,CREATED_DATE DATETIME COMMENT ‘Audit column – indicates date of insert.’,MODIFIED_BY VARCHAR(30) COMMENT ‘Audit column – indicates who made lastupdate.’,MODIFIED_DATE DATETIME COMMENT ‘Audit column – date of last update.’);INSERT INTO STUDENT VALUES (102,’Mr.’,’Fred’,’Crocitto’,’101-09 120thSt.’,’11419′,’718-555-5555′,’Albert Hildegard Co.’,’2003-01-22′,’BROSENZWEIG’,STR_TO_DATE(‘2003-01-22 00:00:00′,’%d-MON-YYYYHH24:MI:SS’),’BROSENZW’,STR_TO_DATE(‘2003-01-22 00:00:00′,’%d-MON-YYYYHH24:MI:SS’));INSERT INTO STUDENT VALUES (103,’Ms.’,’J.’,’Landry’,’7435 Boulevard East#45′,’02124′,’201-555-5555′,’Albert Hildegard Co.’,’2003-01-22′,’BROSENZWEIG’,STR_TO_DATE(‘2003-01-22 00:00:00′,’%d-MON-YYYYHH24:MI:SS’),’BROSENZW’,STR_TO_DATE(‘2003-01-22 00:00:00′,’%d-MON-YYYYHH24:MI:SS’));INSERT INTO STUDENT VALUES (104,’Ms.’,’Laetia’,’Enison’,’144-61 87thAve’,’11435′,’718-555-5555′,’Albert Hildegard Co.’,’2003-01-22′,’BROSENZWEIG’,STR_TO_DATE(‘2003-01-22 00:00:00′,’%d-MON-YYYYHH24:MI:SS’),’BROSENZW’,STR_TO_DATE(‘2003-01-22 00:00:00′,’%d-MON-YYYYHH24:MI:SS’));INSERT INTO STUDENT VALUES (105,’Mr.’,’angel’,’moskowitz’,’320 JohnSt.’,’07024′,’201-555-5555′,’Alex. & Alexander’,’2003-01-22′,’BROSENZWEIG’,STR_TO_DATE(‘2003-01-22 00:00:00′,’%d-MON-YYYYHH24:MI:SS’),’BROSENZW’,STR_TO_DATE(‘2003-01-22 00:00:00′,’%d-MON-YYYYHH24:MI:SS’));INSERT INTO STUDENT VALUES (106,’Ms.’,’Judith’,’Olvsade’,’29 ElmwoodAve.’,’07042′,’201-555-5555′,’Competrol Real Estate’,’2003-01-22′,’BROSENZWEIG’,STR_TO_DATE(‘2003-01-22 00:00:00′,’%d-MON-YYYYHH24:MI:SS’),’BROSENZW’,STR_TO_DATE(‘2003-01-22 00:00:00′,’%d-MON-YYYYHH24:MI:SS’));INSERT INTO STUDENT VALUES (214,’Ms.’,’Yvonne’,’Williams’,’80-20 4th Ave.#A3′,’10004′,’718-555-5555′,’Iarriott Hotels’,’05-FEB-03′,’BROSENZWEIG’,STR_TO_DATE(’05-FEB-2003 00:00:00′,’%d-MON-YYYYHH24:MI:SS’),’BROSENZW’,STR_TO_DATE(’08-FEB-2003 00:00:00′,’%d-MON-YYYYHH24:MI:SS’));insert INTO STUDENT VALUES (232,’Ms.’,’Janet’,’Jung’,’118-18 Union Tpke#3K’,’10015′,’718-555-5555′,’Plannning, Health S.’,’08-FEB-03′,’BROSENZWEIG’,STR_TO_DATE(’08-FEB-2003 00:00:00′,’%d-MON-YYYYHH24:MI:SS’),’BROSENZW’,STR_TO_DATE(’11-FEB-2003 00:00:00′,’%d-MON-YYYYHH24:MI:SS’));CREATE TABLE INSTRUCTOR(INSTRUCTOR_ID INT COMMENT ‘The unique ID for an instructor.’,SALUTATION VARCHAR(5) COMMENT ‘This instructor”s title (Mr., Ms., Dr., Rev.,etc.)’,FIRST_NAME VARCHAR(25) COMMENT ‘This instructor”s first name.’,LAST_NAME VARCHAR(25) COMMENT ‘This instructor”s last name’,STREET_ADDRESS VARCHAR(50) COMMENT ‘This Instructor”s street address.’,ZIP VARCHAR(5) COMMENT ‘The postal zip code for this instructor.’