Pages

Monday, 6 March 2017

32.9 Copy table) Suppose the database contains a student table defined as follows:
create table Student1 (
username varchar(50) not null,
password varchar(50) not null,
fullname varchar(200) not null,
constraint pkStudent primary key (username)
);
Create a new table named Student2 as follows:
create table Student2 (
username varchar(50) not null,
password varchar(50) not null,
firstname varchar(100),
lastname varchar(100),
constraint pkStudent primary key (username)
);
A full name is in the form of firstname mi lastname or firstname
lastname . For example, John K Smith is a full name. Write a program that copies table Student1 into Student2 . Your task is to split a full name into
firstname , mi , and lastname for each record in Student1 and store a new
record into Student2 .