create database GA2 go use GA2 go create table salesman( salesman_id int primary key, name varchar(30), city varchar(20), commission varchar(30) ); insert into salesman (salesman_id, name, city, commission) values (5001, 'James Hoog', 'New York', 0.15); insert into salesman (salesman_id, name, city, commission) values (5002, 'Nail Knite', 'Paris', 0.13); insert into salesman (salesman_id, name, city, commission) values (5005, 'Pit Alex', 'London', 0.11); insert into salesman (salesman_id, name, city, commission) values (5006, 'Mc Lyon', 'Paris', 0.14); insert into salesman (salesman_id, name, city, commission) values (5007, 'Paul Adam', 'Rome', 0.13); insert into salesman (salesman_id, name, city, commission) values (5003, 'Lauson Hen', 'San Jose', 0.12); Create table Customer ( customer_id int primary key, cust_name varchar(30), city varchar(10), grade varchar(30), salesman_id varchar(30)(select salesman_id from salesman); why does my sql server code not work, at the customer table?
create
go
use GA2
go
create table salesman(
salesman_id int primary key,
name varchar(30),
city varchar(20),
commission varchar(30)
);
insert into salesman (salesman_id, name, city, commission) values (5001, 'James Hoog', 'New York', 0.15);
insert into salesman (salesman_id, name, city, commission) values (5002, 'Nail Knite', 'Paris', 0.13);
insert into salesman (salesman_id, name, city, commission) values (5005, 'Pit Alex', 'London', 0.11);
insert into salesman (salesman_id, name, city, commission) values (5006, 'Mc Lyon', 'Paris', 0.14);
insert into salesman (salesman_id, name, city, commission) values (5007, 'Paul Adam', 'Rome', 0.13);
insert into salesman (salesman_id, name, city, commission) values (5003, 'Lauson Hen', 'San Jose', 0.12);
Create table Customer (
customer_id int primary key,
cust_name varchar(30),
city varchar(10),
grade varchar(30),
salesman_id varchar(30)(select salesman_id from salesman);
why does my sql server code not work, at the customer table?
Step by step
Solved in 2 steps