Unit 1(Laboratory) Flashcards

1
Q

Creating tables in sqlserver

A

create table tbl_sample (
s_id int not null identity(1,1) primary key,
s_name varchar(500),
s_amt money,
s_unit int,
s_price decimal(10,4))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Creating tables in mysql

A

create table tbl_sample (
s_id int not null auto_increment primary key,
s_name varchar(500),
s_amt decimal(10,4),
s_unit int,
s_price decimal(10,4))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

the difference between the foreign keys of Sql Server and MySQL

A

s_id int not null identity(1,1) primary key – SQL Server

s_id int not null auto_increment primary key – MySQL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

creating indexes in sql server and mysql

A

//SQL Server
create unique index emp_testdex on tbl_test(emp_num, test_code, test_date);
//MySQL
create unique index emp_testdex on tbl_test(emp_num(15), test_code(10), test_date);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

if you want to put the indexes into asc and desc

A

//SQL Server and MYSQL
create index prod_pricex on tbl_product(p_price desc);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

deleting an index

A

drop index indexname on tablename

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

dropping or eliminating an index

A

//SQL Server and MYSQL
drop index prod_pricex on tbl_product;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly