[更新结构表]求SQL作业的答案,题目内详,送祭扫
- CrazyT没有表结构么?
- yangzhicai乍看下很简单,但是没表咋写
- 大家好我是小叮当话说这么简单的玩意儿LZ也要拿到TG求助么? 连表都不给出.
别人给你的东西,始终不是你自己的
这种东西随便看看书,半天也就都会了.
[本帖最后由 大家好我是小叮当 于 2011-6-6 09:52 编辑] - 天才GK我是知道简单,但是我真的完全不会啦
还两个小时要交作业。。。跪谢 - mirokuneal先写几个吧,给点祭扫吧
Write a SQL statement to display First and Last Names.
SELECT First_Name, Last_Name
FROM Student
Write a SQL statement to display the Majors of students with no duplications.
SELECT DISTINCT(Major)
FROM Student
Write a SQL statement to display the First and Last names of students who live in the Zip code 88888.
SELECT First_Name, Last_Name
FROM Student
WHERE zip='88888'
Write a SQL statement to display the First and Last names of students who live in the Zip code 88888 and have the major of Biology.
SELECT First_Name, Last_Name
FROM Student
WHERE zip='88888' AND major='Biology' - 天才GK第一个是不是应该把Instructor的名字也显示出来的?怎么搞呢?
- 大家好我是小叮当Write a SQL statement to display First and Last Names.
select first_name , last_name from student
Write a SQL statement to display the Majors of students with no duplications.
select distinct major from student
Write a SQL statement to display the First and Last names of students who live in the Zip code 88888.
select first_name , last_name from student where zip='88888'
Write a SQL statement to display the First and Last names of students who live in the Zip code 88888 and have the major of Biology.
select first_name,last_name from student where zip='88888' and major='Biology'
Write a SQL statement to display the First and Last names of students who live in the Zip code 88888 or 88808.
Do not use IN.
select first_name,last_name from student where zip='88888' or major='Biology'
Write a SQL statement to display the First and Last names of students who have the major of Biology or Math. Use IN.
select first_name,last_name from student where major in ('Biology','Math')
Write a SQL statement to display the First and Last names of students who have a Status greater than 1 and less than 10. Use BETWEEN.
select first_name , last_name from student where status between 1 and 10 - mirokuneal(SELECT First_Name, Last_Name
FROM Student)
UNION
(SELECT First_Name, Last_Name
FROM Instructor) - 天才GK小叮当真猛
还有三个拜托啦!给你连续骚一个礼拜都可以! - 天才GK这个真好用,谢谢
- 大家好我是小叮当Write a SQL statement to display the First and Last names of students who have a Last Name that starts with S.
select first_name, last_name from student where charindex('S',last_name)=1
Write a SQL statement to display the First and Last names of students who have an 'a' in the second position of their First Name.
select charindex('a',first_name,2), last_name from student - 天才GK小叮当,显示charindex这个函数未定义。。。
你有Q么?加一下我 1191570 - 大家好我是小叮当在外面不方便q
怎么会charindex未定义? 你什么数据库? 不会是access查询吧.
charindex不行就用like写吧
[本帖最后由 大家好我是小叮当 于 2011-6-6 10:39 编辑] - Eurydice猛男有啥SQL的入门书推荐不?
- 天才GK我是Access 2007
Like 我会用了,谢谢 - 大家好我是小叮当难怪,access是没有charindex的.
Write a SQL statement to display the First and Last names of students who have a Last Name that starts with S.
select first_name, last_name from student where last_name like 'S%'
用like的话,这样就可以了. - 大家好我是小叮当我不知道现在外面有什么书.我10年前用的书是这两本,足够了.
- slowsonic这个级别的作业估计就是考Like,charIndex不会这么早学
Write a SQL statement to display the First and Last names of students who have an 'a' in the second position of their First Name.:
答案: select first_name, Last_name from student where first_Name like '_a%' - 天才GK我写的是 like '?a*'.......是不是dos用多了的不好的习惯?也可以的吧?
- slowsonic看用什么软件了,我用MS SQL,你的这个肯定不行。
- hodei1已经有人做了啊。。。