由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - Questions on SQL
相关主题
help! A bug about date type !怎么写这个Query,谢谢
help needA question about recursive query
#在SQL里啥子意思Urgent help needed, please
誰來幫我開來開悄? Interesting SQL queryHow to replace 0 with empty?
转换成时间的格式 MS SQLAbout INSERT IGNORE
问一个SQL Server的问题mysql index优化求助 (转载)
SQL question HELP那我也出个两个sql大家当练习吧,没有递归,beijing给发包子
help: question on oracle sys_context()这个sql插入如何操作?
相关话题的讨论汇总
话题: key话题: sql话题: select话题: questions话题: table
进入Database版参与讨论
1 (共1页)
r***n
发帖数: 4
1
1. When you give the 'select' command in SQL, is it to 'select * from
' or to 'select * from '?
2. 一个表的外键(foreign key)是否一定是另一个表的主键(prime key)?
b***s
发帖数: 111
2

table
yes

【在 r***n 的大作中提到】
: 1. When you give the 'select' command in SQL, is it to 'select * from
: ' or to 'select * from '?
: 2. 一个表的外键(foreign key)是否一定是另一个表的主键(prime key)?
a*****i
发帖数: 4391
3

select * from
Yup.

【在 r***n 的大作中提到】
: 1. When you give the 'select' command in SQL, is it to 'select * from
: ' or to 'select * from '?
: 2. 一个表的外键(foreign key)是否一定是另一个表的主键(prime key)?
j**y
发帖数: 147
4
在 Roman (想念她的教授) 的大作中提到: 】
I don't think so. See the following:
CREATE TABLE EMPLOYEE
( FNAME VARCHAR(15) NOT NULL,
LNAME VARCHAR(15) NOT NULL,
SSN CHAR(9) NOT NULL,
......
SUPERSSN CHAR(9),
.....
PRIMARY KEY (SSN)
FOREIGN KEY (SUPERSSN) REFERENCES EMPLOYEE(SSN));
The foreign key of this table references the primary key of itself.
l***u
发帖数: 157
5

So its foreign key is its primary key. The importance is it must be
a primary key no matter belongs to which table.

【在 j**y 的大作中提到】
: 在 Roman (想念她的教授) 的大作中提到: 】
: I don't think so. See the following:
: CREATE TABLE EMPLOYEE
: ( FNAME VARCHAR(15) NOT NULL,
: LNAME VARCHAR(15) NOT NULL,
: SSN CHAR(9) NOT NULL,
: ......
: SUPERSSN CHAR(9),
: .....
: PRIMARY KEY (SSN)

a*****i
发帖数: 4391
6

Your point?

【在 j**y 的大作中提到】
: 在 Roman (想念她的教授) 的大作中提到: 】
: I don't think so. See the following:
: CREATE TABLE EMPLOYEE
: ( FNAME VARCHAR(15) NOT NULL,
: LNAME VARCHAR(15) NOT NULL,
: SSN CHAR(9) NOT NULL,
: ......
: SUPERSSN CHAR(9),
: .....
: PRIMARY KEY (SSN)

1 (共1页)
进入Database版参与讨论
相关主题
这个sql插入如何操作?转换成时间的格式 MS SQL
问个查询问题。问一个SQL Server的问题
MySQL table either insert or drop/truncate table running foreverSQL question HELP
SQL, recruiter发过来的面试题 (转载)help: question on oracle sys_context()
help! A bug about date type !怎么写这个Query,谢谢
help needA question about recursive query
#在SQL里啥子意思Urgent help needed, please
誰來幫我開來開悄? Interesting SQL queryHow to replace 0 with empty?
相关话题的讨论汇总
话题: key话题: sql话题: select话题: questions话题: table