I'm finishing up a beginning SQL class where we learned on an Oracle
database and the transition to working on SQL Server is easy. The next more
advanced course will be in PL/SQL, but I know I will be working on SQL
Server in the workplace, so my question is if I should take this course.
Will I benefit from the basic philosophies that will be covered, or will it
just make a transition for me more difficult? Will it be partly a waste of
time and money and I'd be better served getting a book and self teaching
myself? I know that in a greater sense learning something isn't necessarily
a waste, but I mean from the perspective of my goal of being able to use Sql
Server, will this course be useful?
i'm currently a student in computer information sciences, and i wanted to give my studying some more focus thus choosing dba. now i'd like to dba but be as broad as possible when i first start out my career. i know some programming languages and recently finished a C# book for doing .net development and a ASP.net book for scripting. but where should i go from here? should i just start studying ms sql server? what about a microsoft certification? i'm very curious to know where the next step in my studying should be, so anyone who was in my shoes, i'd love to hear any information you have to offer. TIA
I am starting a class on SQL Server, and my school wants me to builddb's either on campus or remotely at my home connecting to their SQLServer Enterprise.Will I be okay to use Developer Edition at home to connect with anEnterprise-licensed SQL Server on campus, to build databases,sprocs, .net apps that connect to the database stored on my school'sserver?I would rather avoid the Express edition.thanks
I'm a kid and I'd like to know what kind of work a database administrator does. It would be great to learn from a real database administrator how you spend your typical day at the office. What are some of your main duties? Thanks so much in advance.
I need to calculate average of each student and then get the highest.
My try:
Code: SELECT Students.StudentId,Students.StudentName,AVG(Grades.Grade) AS avg_grade FROM Students s JOIN Grades g ON Grades.StudentId =Students.StudentId GROUP BY Students.StudentId, Students.StudentName
ORDER BY avg_grade LIMIT 1 FROM Students;
I encounter problem with this code, maybe it's Completely wrong...
CREATE TABLE [dbo].[Student]( [StudentNumber] [varchar](50) NOT NULL, [Name] [char](50) NOT NULL, [Contact] [int] NOT NULL, [Address] [char](50) NOT NULL, [DateOfBirth] [datetime] NOT NULL, [YearEnrolled] [int] NOT NULL, [Year] [int] NOT NULL;
And insert the following data:
INSERT INTO Student VALUES('IT123456X', 'Ahmad Adam','05-18-1997', '33 Mangis Rod', 19970518, 2013, 1); INSERT INTO Student VALUES('IT334455U', 'Mary Tan', '01-23-1996', '51 Koon Seng Road', 23-01-1996, 2012, 1); INSERT INTO Student VALUES('BS123456X', 'Samuel Lee', '03-30-1997', '2 Joo Chiat Lane', 30-03-1997, 2013, 1); INSERT INTO Student VALUES('BS234234Z', 'Nathaniel Koh', '12-08-1997', '5 Stll Road', 08-12-1997, 2013, 1); INSERT INTO Student VALUES('BS987987F', 'Siti Faridah', '07-04-1995', '3 Duku Road', 04-07-1995, 2011, 3)
How do i calculate the age and how can i group by the StudentNumber like 'IT%'
We have SQL database now a days we are planing to update our students ID Records but i don't know the exact query for this. Table format is below
StudentID Name 500132253/Prep Aslam 112344883/Prep Ali 451132537/Prep Ahmed
Now i want to update only the grade from prep to KG-1 without update the registration number only prep to kg-1. in one column there is student register number and after slash the grade.
I am stumped on a set-based approach for this one.
A cursor approach is straightforward enough, but i want to avoid that.
Here's my table:
create table StudentScores ( id int primary key identity(1,1), student_id int not null, score int not null )
with some sample data:
insert into StudentScores (student_id, score) select 1, 10 union all select 1, 29 union all select 1, 50 union all select 1, 53 union all select 1, 45 union all select 1, 10 union all select 1, 29 union all select 1, 50 union all select 1, 53 union all select 1, 45 union all select 1, 88 union all select 2, 23 union all select 2, 54 union all select 2, 55 union all select 2, 34 union all select 2, 56 union all select 2, 78 union all select 2, 23 union all select 2, 54 union all select 2, 55 union all select 2, 34 union all select 2, 56 union all select 2, 78 union all select 2, 23 union all select 2, 54 union all select 2, 55 union all select 2, 34 union all select 2, 56 union all select 2, 78 union all select 2, 98
What I want is, for each student, what is their 90th percentile score?
For a given single student, one possibility would be:
declare @studentid int set @studentid = 2 select top 1 @studentid as student_id, a.score as [90th percentile score] from ( select top 90 percent score from StudentScores where student_id = @studentid order by score asc ) as a order by a.score desc
But I want this for all students, and not use a cursor.
I am trying to find out the the Average number of contact hours per student. in Reporting Services 2005. The contact hours is the in the Totaltime field
Is this formula correct
=Sum(Fields!TotalTime.Value)/Avg(Fields!TotalTime.Value) is in the =Fields!StateServices.Value Group
I have a csv that contains attendance records that I get daily from a 3rd party grade book solution. I need to import directly into the attend table in our student database.
The file is setup as follows, School Year, school number, student_id, absence date, absence code, course number, section number.
I need to check the student schedule to see if they are scheduled for that class when the import runs. So if they had a schedule change in the middle of the day it won't post attend to a dropped class.
I have done something similar to this before with the way I export teachers out to our grade book. I have it check the master schedule to see if the teacher is teaching at least one class, that way it won't export tutors and office staff to the grade book. I used the script below to do that but not sure who to apply it to a bulk insert.
Code: Script Used to export teachers note last four lines, checks master USE [GSchool] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON
[Code] ....
Secondly I need to check the date of the record and overwrite a record if one already exists for that exact course and section for that student, I need this because if they make changes to a previous day from absence un excused to excused I need to get rid of the unexcused by overwriting it.
One more thing that would be nice but is optional, is there a way to send log of errors on the import via email?
i am having problem putting this query to calculate students grade using the condition and legend bellow.
WHEN EXAMS BETWEEN 75 AND 100 THEN 'A' WHEN EXAMS BETWEEN 70 AND 74 THEN 'AB' WHEN EXAMS BETWEEN 65 AND 69 THEN 'B' WHEN EXAMS BETWEEN 60 AND 64 THEN 'BC'
In my query, I am showing Student Record and also want to retrieve the last class attended by the student using JOIN to the table (ClassHistory).
Master ID Student_Name 1 Arindam 2 Brenda 3 Callie
(ClassHistory) ID Class Year 1 4 2003 1 5 2004 1 6 2005 2 4 2003 2 5 2004 3 4 2003
DESIRED RESULTSET ID Student_Name Class Record 1 Arindam 6 2 Brenda 5 3 Callie 4
The result is like - Arindam last class was Class 6, while Brenda was in Class 5 and Callie was in class 4.
Please note that the query will b part of a larger query and the Class record to be retrieved from ClassHistory if possible need to be retrieved through JOIN.
I can fetch the counts for total present and absent
Query i have tried is
Declare @StudentId Uniqueidentifier ='0B2D4D41-8D33-4D79-A981-03E0F093F458' Begin select A.StudentId ,A.Date,Count(Date)Total,B.Guid,
[Code] ....
AS result of this query i get the data.Present count and Absent count from date inserted in Dailyattendance tables.
SO my problem is if the student have promoted to next class then by this query it will count the before year also how do i need to calculate the count according to the Class StartDate and Enddate as i mention in the Class Details table what will be the query.
I have MS SQL 2000 and 2005 Express install on my computer. I would like to know where I can get some good beginner's training and I also need to know how to run sql scripts and import database to both.
I have a SQL server that my web host has provided but I don't know who to set it up! I'm currently have an MS Access database on my web site and I want to change it to MSSQL using the Access upsizing wizards, can anyone talk me through it?
hi there. this is my first post on this forum. im new to SQLServer so please go easy on me. :)
i am trying desperately to call a stored procedure from within another stored procedure. if i post my code below could somebody tell me where i am going wrong. the SP i have written is executing OK but the OUTPUT parameter Id_User is coming back as null, whereas it should be giving my a value there. i have tried changing the line 'EXEC sp_User_I' for 'INSERT INTO @User_Id EXEC sp_User_I' but this wont compile.
CREATE PROCEDURE sp_Account_I] @Username varchar(16), @Password varchar(88), @Surname varchar(32), @DateBirth datetime, @Email varchar(64), @Id_Account int OUTPUT, @Id_User int OUTPUT
I've been banging my head against this issue, and I haven't managed to find a solution. I was hoping that maybe somebody here has done something similar.
I am trying to get the latest available pricing from a Rate table, which is based on the customer ID and the provided date from another table (Table1).
This is what the code looks like, essentially:
select table1.* ,table2.* ,table3.Rate
from table1 left outer join table2 on table1.Id = table2.Id left outer join ( Select Top 1 Rate from RateTable Where RateTable.date < table1.date order by RateTable.date desc ) as table3 on table3.custId = table1.custId
I understood that table1.date can't be explicitly passed into the nested join within table3, but does anybody know a work around that can achieve the above example (the environment is SQL server 2000 and inside a view not on in a stored proc)?
Hi,I am completely new to the BCP utility and fairly new to SQL ServerI am learning from a book and I am trying the following example (the serverI'm learning on is called contractor and a password has not been give to thesa)bcp pubs..authors out authors.txt -C -r -t, -U sa -P -S contractorWhen I run this in Query Analyser i get the error message..Server: Msg 170, Level 15, State 1, Line 1Line 1: Incorrect syntax near '.'.I have tried puuting quotes around the database and the table name asfollows-bcp "pubs..authors" out authors.txt -C -r -t, -U sa -P -S contractorand get the errorServer: Msg 179, Level 15, State 1, Line 1Cannot use the OUTPUT option when passing a constant to a stored procedure.Please can anybody help me to get this first bit working?Thanks in anticipation.
is there any SQL server book or online meterial for beginners?? i've checked msdn its seems not helpful at beginner level.like issues for installing and first time configuring SQL Server. and installing its clients etc.
hello all i'm new in dot net and as every one beginning in something i have some problems hope u guys can help me my first question is really easy i'm feeling silly to ask such a question i made database in sql server 2005 and i made a table and columns but i cant insert data into the table i dont know how to fill the table with data? my second question is can i convert sql server 2000 database to 2005 if i can how i cando that? that's all for now hope u can really help me thanks in advance
My company needs a database. My first thought was to do it in Access, because it's available! But I wanted to check that that was smart, what its limitations are, when it's better to move to bigger / more expensive software, etc.
It's probably going to have several hundred thousand records in and will grow by more than a hundred thousand every year. Is there a size limit?
Not that many fields, though - it's not that complicated a database.
tables with words in Italian and English. Connect1(#id,id1,id2); connecting word form Eng with Ita translation. Connect2(#id,id1,id2); same for Italian.
Is this correct? 3. normalisation? Will this work?
if i am creating an SP then i only specify output parameters if the SP is to return a single set of values. is that correct? if my SP is returning multiple rows from a SELECT statement then i would not specify any parameters on the SP. can somebody clarify this for me. thanks!
I am new to database programming... i know the answer is somewhere in the past forums and i unfortunately i can't locate it... I have this problem i hope you can help me.
I am trying to insert values into table hosp_wareitem and one of it is the itemid where in i would like to get the item id of an existing medicine... (i hope you can understand me guys) here is my query.. right now im puzzled and i know the answer is already there.. i just cant see it...
set xact_abort on declare @id as integer begin transaction select @id (select medicines_id from hosp_medicines where medicines_id = medicines_id) insert into Hosp_WareItem (ItemID, Department_ID, SalesGL_Code, COSGL_Code, InventoryGL_Code, ExpenseGL_Code, ReadersFeeGL_Code, CreateBy, UpdateBy, DeleteBy, CreateDate, UpdateDate, DeleteDate) values (@ID, '1', 'AAA-111', 'AAA-000', 'AAA-112', '', '', '0', '', '', '1/1/1900 12:00:00 AM', '1/1/1900 12:00:00 AM', '') Update Hosp_Counter set Counter_ID = @ID where Table_Description = 'wareitem' commit transaction
it returns an error
(1 row(s) affected)
(24 row(s) affected)
Server: Msg 515, Level 16, State 2, Line 6 Cannot insert the value NULL into column 'ItemID', table 'Medix_Hospital.dbo.Hosp_wareitem'; column does not allow nulls. INSERT fails.
it tries to insert a null value in itemid because it cant get the value of the medicine_id.