SQL问题解释

来源:百度知道 编辑:UC知道 时间:2024/06/06 03:39:27
(SQL )

I.
i. Explain how to add columns to an existing table.

ii. Describe the difference between drop a table and deleting all rows in a table.

iii. Explain the need to create a view and when it is useful to create it.

iv. The difference between equi-join and a natural (inner) join.

v. Explain the usage of outer-join and self-join.
不是翻译。。。

1.表中插入列:
alter table <表名>
[add <新列名><数据类型>[完整性约束]]
2.删除表,当基本表一旦被删除,表中的数据及相应建立的的索引和视图都将被自动删除.而删除表中所有的行及数据只是将表变成一张空表,其结构仍在.
3.视图是关系数据库系统提供给用户以多角度观察数据库中数据的一种重要方法.视图是从一个或几个基本表或视图导出的一个虚拟表.视图一经定义就可以和基本表一样被查询.删除,根据自己的需要或经常需要查询的数据导出视图,可使查询变得更方便快速.
4.等值连接与自然连接的区别:等值连接就是自然连接!!!
5.外连接和自身连接的区别:外连接包括左连接和右连接.
左连接在结果表中包含第一个表中满足条件的所有记录,返回
第二个表在连接条件上匹配的记录.
右连接在结果表中包含第二个表中满足条件的所有记录,返回
第一个表在连接条件上匹配的记录.

i . alter table table1 add column col_new datatype
ii.drop a table:you will lost a table include it's describsion and physical files,delete talbe: only cause the date you specify will be deleted.
iii.create a view can enable the database use it's buffer to execute a query executed before,so the database needs less time to deal with your query,and it can deal with more complicate query with an easy way too.
后面的两个实在写不下去了。你自己查查资料好了。或者按照上面老兄的说法翻译下好了。

一。解释如何添加栏目,以现有的表格。

二。描述 删除表 和 删除所有 的行之间的不同。