IT: e-government
IT: e-government

Start this free course now. Just create an account and sign in. Enrol and complete the course for a free statement of participation or digital badge if available.

Free course

IT: e-government

3.4 Using a query language

When you search a large website for information, for instance when you search a large e-government site, very often, behind the scenes, a large relational database is being searched. I mentioned earlier the use of SQL as a way of extracting information from a database. Depending on the system being used, your enquiry may be converted into an SQL query, and this finds the information you need. For example, suppose we wanted to find the family names of all people enrolled on the digital photography course (E02) in the last section. Below is an SQL query to find this information. (There are other ways to construct this query using SQL.)




I will briefly explain how the query works. It is based on the idea of merging Tables 2 and 4 ('Table_2 join Table_4'), subject to certain constraints. One constraint is that the student_keys must be equal ('On Table_2.Student key=Table_4.Student_key'). In effect, the merged table is like Table 2, but with an extra column giving the course codes for each student. However, the only records included in this table are those for which the course code is E02, as specified in the condition 'Where course_code='E02''. The first instruction ('select family_name') retrieves the required information from this joint table.

Skip Your course resources

Take your learning further

Making the decision to study can be a big step, which is why you'll want a trusted University. The Open University has 50 years’ experience delivering flexible learning and 170,000 students are studying with us right now. Take a look at all Open University courses.

If you are new to University-level study, we offer two introductory routes to our qualifications. You could either choose to start with an Access module, or a module which allows you to count your previous learning towards an Open University qualification. Read our guide on Where to take your learning next for more information.

Not ready for formal University study? Then browse over 1000 free courses on OpenLearn and sign up to our newsletter to hear about new free courses as they are released.

Every year, thousands of students decide to study with The Open University. With over 120 qualifications, we’ve got the right course for you.

Request an Open University prospectus371