avatar
Questions on SQL# Database - 数据库
r*n
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页)
相关主题
这个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
avatar
b*s
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页)
相关主题
这个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
avatar
a*i
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)

avatar
j*y
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.
avatar
l*u
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)

avatar
a*i
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)

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。